<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=0.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no"/>
    <link href="/assets/src/css/tijiao.css" type="text/css" rel="stylesheet"/>
    <script src="/assets/js/jquery-1.8.1.min.js"></script>
    <title>我的订单</title>
    <script type="text/javascript">
    	$(document).ready(function(){
    		$("#pickup").click(function(){
    			var url = "/order/pickup";
    			var reqoid = $("#oid").val();
    			$.post(
    					url,
    					{oid:reqoid},
    					function(data){
    						if(data == 0){
    							window.location.href="/index";
    						}else{
    							if(data == 2){
    								alert("商品已被领取！");
    								$(".zuihou").html("");
    								$(".zuihou").append(
    										"<a href='/index'><div class='zuihou-1'>返回首页</div></a>"+
    										"<div class='zuihou-2' style='background: rgba(0,0,0,0.3)'>"+
    										"<p class='wo-1'><span class='wo-2'>已取件</span></p></div>"
    								);
    							}else{
    								if(data == 1){
    									alert("领取成功，请等待柜门打开！");
    									$(".zuihou").html("");
        								$(".zuihou").append(
        										"<a href='/index'><div class='zuihou-1'>返回首页</div></a>"+
        										"<div class='zuihou-2' style='background: rgba(0,0,0,0.3)'>"+
        										"<p class='wo-1'><span class='wo-2'>已取件</span></p></div>"
        								);
    								}
    							}
    						}
    					}
    					);
    		});
    		
    		
    	
    	});
    
    </script>
</head>
<body>
<!--头部-->
<div class="top-1">
<a href="/order/myorder" class="jian-1"><img width="10px" height="16px" src="/assets/src/images/jai_52.png"></a>
<p class="ke-1">购买成功</p>
</div>
<!--获奖-->
<div class="ni">
<p class="ni-1">恭喜你购买成功</p>
<p class="ni-2">${commoditiesDetail.coName }</p>
<!--奖状-->
<div class="yuan"><img class="tupian" width="135px" height="95px" src="/read/upload?name=/${commoditiesDetail.coPhoto }"><p class="xiao"></p></div>
</div>

<div class="manyi">
<p class="manyi-1">订单编号：${order.runNum }</p>
<p class="manyi-2">金额：${order.orderPrice }</p>
</div>
<!--底部-->
<div class="zuihou clearfix">
	<a href="/index"><div class="zuihou-1">返回首页</div></a>
	<c:if test="${order.isPick==0}">
		<input id="oid" type="hidden" value="${order.id }">
		<div id="pickup" class="zuihou-2"><p class="wo-1"><span class="wo-2">直接取件</span></p></div>
	</c:if>
	<c:if test="${order.isPick==1}">
		<div class="zuihou-2" style="background: rgba(0,0,0,0.3)"><p class="wo-1"><span class="wo-2">已取件</span></p></div>
	</c:if>
</div>
</body>
</html>